<template>
	<view class="wrap bgw content">
		<image class="IconTypes" src="../../static/image/SuccessType.png" mode=""></image>
		<p class="p1">
			预定成功
		</p>
		<p class="p2">商家正在努力为您配货</p>
		<!-- <u-button :ripple="true" type="success">重新提交</u-button> -->
		<u-button type="success" @click="toOrderPage">查看订单</u-button>
		<!-- 轮播 -->
		<view v-if="advertList != '' " class="banner">
			<swiper class="screen-swiper square-dot" :indicator-dots="true" :circular="true" :autoplay="true" interval="3000"
			 duration="500"> 
				<swiper-item @tap="openAdver(v)" v-if="v.path" v-for="(v,i) in advertList" :key="i" style="z-index: 0;">
					<image :src="v.path" mode="aspectFill"></image>
				</swiper-item>
			</swiper>
		</view>
	</view>
</template>

<script>
	import {adList} from '@/api/api.js'
	export default {
		data() {
			return {
				advertList:[],
			};
		},
		onLoad() {
			this.getAdver()
		},
		methods:{
			openAdver(v){
				if(v.isExternalLink){
					plus.runtime.openURL(v.url)
				}else{  
					this.$navigateTo('../webView/webView?url='+v.url)
				} 
			},
			async getAdver(){
				this.advertList  = await adList({
					id:20
				})
				this.advertList = this.advertList.data
			},
			toOrderPage(){
				var url = "../buy/buy";
				this.$common.navigateTo(url);
			},
			onBackPress(){
				uni.switchTab({
					url: '../index/index'
				});
				return true;
			}
		}
	}
</script>

<style lang="less" scoped>
.content{
	text-align: center;
}
.IconTypes{
	margin-top: 88rpx;
	width: 200rpx;
	height: 140rpx;
}
.p1{
	margin-top: 25rpx;
	font-size:36rpx;
	font-family:PingFang SC;
	font-weight:bold;
	color:rgba(26,26,26,1);
}
.p2{
	margin-top: 30rpx;
	font-size:28rpx;
	font-family:PingFang SC;
	font-weight:400;
	color:rgba(136,136,136,1);
}
button{
	margin-top: 100rpx;
	width:400rpx;
	height:78rpx; 
	// box-shadow:0px 4px 16px 0px rgba(22,187,111,0.42);
	border-radius:39px;
}
.banner{
	width: 690rpx;
	height: 160rpx;
	border-radius: 20rpx;
	margin-left: 30rpx;
	margin-top: 220rpx;
	overflow: hidden;
	image{
		width: 690rpx;
		height: 160rpx;
		border-radius: 20rpx;
	} 
	uni-swiper{
		width: 690rpx;
		height: 160rpx; 
	}
}
</style>
